
<script language="javascript" type="text/javascript"
	src="js/prototype.js"></script>
<input type=button value="Test Number.times()" onclick="demoTimes()">
<script> 
function demoTimes(){
	var n = 10;
		n.times(function(index){
		alert(index); 
	}); 
}
</script>

<br>

<input type=checkbox id=myChk value=1 />
TestFunction
<script> 
//declaring the class 
var CheckboxWatcher = Class.create(); 
//defining the rest of the class implementation 
CheckboxWatcher.prototype = {
	initialize: function(chkBox, message) {
		this.chkBox = $(chkBox); 
		this.message = message; 
		//assigning our method to the event 
		this.chkBox.onclick = this.showMessage.bindAsEventListener(this); 
	}, 
	showMessage: function(evt) {
		alert(this.message + ' (' + evt.type + ')'); 
	} 
};
var watcher = new CheckboxWatcher('myChk', 'Changed'); 
</script>

<br>

<span id="myspan" style="color:red;">myspan</span>
<script>
	new Insertion.Before('myspan', ' before ');
	new Insertion.Top('myspan', ' top ');
	new Insertion.Bottom('myspan', ' bottom ');
	new Insertion.After('myspan', ' after '); 
</script>

